package com.zkh.myframe.database.mapper.parser;

/**
 * 解析if条件每个and或or连接的部分
 * @author zkh
 *
 */
public class Part {
	//子条件，如果该字段为空，则simpleField有值，反之simpleField为空
	private String children;
	//最简条件
	private String simpleField;
	//关联逻辑符and或or
	private Boolean and;
	//对当前Part已经计算出来的值
	private boolean value;
	
	public boolean hasChildren() {
		return children!=null;
	}
	public String getChildren() {
		return children;
	}
	public void setChildren(String children) {
		this.children = children;
	}
	public String getSimpleField() {
		return simpleField;
	}
	public void setSimpleField(String simpleField) {
		this.simpleField = simpleField;
	}
	public boolean hasLogic() {
		return and !=null;
	}
	public boolean isAnd() {
		return and;
	}
	public void setAnd(Boolean and) {
		this.and = and;
	}
	public boolean getValue() {
		return value;
	}
	public void setValue(boolean value) {
		this.value = value;
	}
	@Override
	public String toString() {
		return "Part [children=" + children + ", simpleField=" + simpleField + ", and=" + and + "]";
	}
}
